waxClass{"DoubleAttack",HNAbstractLogic}
function init(self)
self.super:init()
self.attack = 2
return self
end

function act (self,a,b,queue)
print ('--attack--')
self.attack  = self.attack - 1

local damage = a.maxdamage
b.tllhp = (b:count()-1)*(b.maxhp) + b.hp
b.tllhp = b.tllhp - damage * a.attack / b.defense 

b:setCount(b.tllhp/b.maxhp)
b.hp = b.tllhp%b.maxhp
center:addObject_forKey(a,'attack')
if b.hp >= 0 then
center:addObject_forKey(b,'beattacked')
else
center:addObject_forKey(b,'die')
end


return self.attack
end


function reset (self)
   self.attack = 2
end
-- return
-- 0 -- normal
-- 1 -- 2 times attack
